package com.gzxw.mogublog.sms.listener;

import com.gzxw.mogublog.sms.utils.SendMailUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: mogublog
 * @author: gzxw
 * @create: 2023-04-14 12:24
 **/
@Component
@Slf4j
public class MailListener {

    @Autowired
    private SendMailUtils sendMailUtils;

    @RabbitListener(queues = "mogu.email")
    public void sendMail(String msg) {
        System.out.println("mogu_sms收到: "+msg);
        sendMailUtils.sendEmail("mogublog","2169559914@qq.com","你收到的邮箱内容为: "+msg);
    }

}
